"""
name: Hello Wold
version: 1.0
"""
# 1，导入相关类
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton

class MyWidget(QWidget):
    def __init__(self):
        super().__init__()
        self.button = QPushButton('点我啊', self)  # 创建子控件QPushButton
        self.button.setGeometry(20, 50, 200, 100)  # 设置button的位置和长宽

app = QApplication([])  # 2，创建QApplication实例

widget = MyWidget()  # 3，创建主窗口
widget.show()  # 4，设置界面为显示状态

app.exec_()  # 5，运行QApplication实例
